// pages/mine/mine.js
const app = getApp()
const request = require("../../utils/request")
Page({

  toSetting() {
    wx.navigateTo({
      url: '/pages/setting/setting',
    })
  },
  toAboutour() {
    wx.navigateTo({
      url: '/pages/aboutour/aboutour',
    })
  },

  data: {
    isLogin:null
  },
  toOver() {
    wx.navigateTo({
      url: '/pages/over/over',
    })
  },
  toStudy() {
    wx.navigateTo({
      url: '/pages/study/study',
    })
  },
  go2activity(){
    wx.navigateTo({
      url: '/pages/myactive/myactive',
    })
  },
  toRefund() {
    wx.navigateTo({
      url: '/pages/refund/refund',
    })
  },
  toSale() {
    wx.navigateTo({
      url: '/pages/sale/sale',
    })
  },
  gotopaid() {
    wx.navigateTo({
      url: '/pages/tobepaid/tobepaid',
    })
  },
  gotooppen() {
    wx.navigateTo({
      url: '/pages/open/open',
    })
  },
  gotoconsult() {
    wx.navigateTo({
      url: '/pages/consult/consult',
    })
  },
go2Collection(){
wx.navigateTo({
  url: '/pages/collection/collection',
})
},
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.setData({
      isLogin:app.globalData.loginUser
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  // 登陆接口
  async doLogin(){
    if(!this.data.isLogin){
      wx.navigateTo({
        url: '/pages/login/login',
      })
    }else{
      app.globalData.loginUser=null
      this.onShow()
    }
   
  }
})